from PIL import Image
import io

def resize_(avatar,height,width):
    with Image.open(io.BytesIO(avatar)) as img:
        img1=img.resize((height,width))
        output = io.BytesIO()
        img1.save(output, format=img.format)
        return  output.getvalue()